use "$data/demog_meta.dta", clear

twoway conn b_2010_high x_2010_high if x_2010_high>=5.5&x_2010_high<10||/*
*/conn b_2011_high x_2011_high if x_2011_high>=5.5&x_2011_high<10||/*
*/conn b_2012_high x_2012_high if x_2012_high>=5.5&x_2012_high<10||/*
*/conn b_2013_high x_2013_high if x_2013_high>=5.5&x_2013_high<10||/*
*/, ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(5.5(1)10) ylabel(0 (200) 1000) xline(6.5)/*
*/ legend(label(1 "2010") label(2 "2011") label(3 "2012") label(4 "2013")) xtitle(Rate Spread)
graph export "$figures/figure1_panela.eps", as(eps) preview(on) replace

twoway conn b_2010_low x_2010_low if x_2010_low>=7.5&x_2010_low<12||/*
*/conn b_2011_low x_2011_low if x_2011_low>=7.5&x_2011_low<12||/*
*/conn b_2012_low x_2012_low if x_2012_low>=7.5&x_2012_low<12||/*
*/conn b_2013_low x_2013_low if x_2013_low>=7.5&x_2013_low<12||/*
*/, ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(7.5(1)12) ylabel(0 (200) 1000) xline(8.5)/*
*/ legend(label(1 "2010") label(2 "2011") label(3 "2012") label(4 "2013")) xtitle(Rate Spread)
graph export "$figures/figure1_panelb.eps", as(eps) preview(on) replace



twoway conn b_2013_high x_2013_high if x_2013_high>=5.5&x_2013_high<10, msymbol(T)||/*
*/conn b_2014_high x_2014_high if x_2014_high>=5.5&x_2014_high<10, msymbol(S)||/*
*/conn b_2015_high x_2015_high if x_2015_high>=5.5&x_2015_high<10, msymbol(D)||/*
*/conn b_2016_high x_2016_high if x_2016_high>=5.5&x_2016_high<10, msymbol(X)||/*
*/conn b_2017_high x_2017_high if x_2017_high>=5.5&x_2017_high<10,/*
*/ ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(5.5(1)10) xline(6.5)/*
*/ legend(label(1 "2013") label(2 "2014") label(3 "2015") label(4 "2016") label(5 "2017")) xtitle(Rate Spread)
graph export "$figures/figure1_panelc.eps", as(eps) preview(on) replace



twoway conn b_2013_low x_2013_low if x_2013_low>=7.5&x_2013_low<12||/*
*/conn b_2014_low x_2014_low if x_2014_low>=7.5&x_2014_low<12||/*
*/conn b_2015_low x_2015_low if x_2015_low>=7.5&x_2015_low<12||/*
*/conn b_2016_low x_2016_low if x_2016_low>=7.5&x_2016_low<12||/*
*/conn b_2017_low x_2017_low if x_2017_low>=7.5&x_2017_low<12,/*
*/ ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(7.5(1)12) xline(8.5)/*
*/ legend(label(1 "2013") label(2 "2014") label(3 "2015") label(4 "2016") label(5 "2017")) xtitle(Rate Spread)
graph export "$figures/figure1_paneld.eps", as(eps) preview(on) replace


